import request from './request'
import qs from 'qs'

const http = {
  get(url, params, headers) {
    const config = {
      method: 'GET',
      url,
      params: params || {},
      headers: headers || {},
      paramsSerializer: (params) => {
        return qs.stringify(params, { indices: false })
      }
    }
    return request(config)
  },
  post(url, data, headers) {
    const config = {
      method: 'POST',
      url,
      data: data || {},
      headers: headers || {}
    }
    return request(config)
  }
}
export default http
